//
//  MyExpressTableViewCell.m
//  Express
//
//  Created by lanou on 16/1/18.
//  Copyright © 2016年 FJY. All rights reserved.
//

#import "MyExpressTableViewCell.h"
#import "BaseHeader.h"

@implementation MyExpressTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
    
        self.expressOrderNumber = [[UILabel alloc] initWithFrame:CGRectMake(25, 0, kWidth, 20)];
        [self.contentView addSubview:self.expressOrderNumber];
        
        self.expressCompany = [[UILabel alloc] initWithFrame:CGRectMake(self.expressOrderNumber.frame.origin.x , self.expressOrderNumber.frame.origin.y + self.expressOrderNumber.frame.size.height, kWidth, 20)];
        [self.contentView addSubview:self.expressCompany];
        
        self.number = [[UILabel alloc] initWithFrame:CGRectMake(0, self.expressOrderNumber.frame.origin.y + self.expressOrderNumber.frame.size.height, 20, 20)];
        self.number.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:self.number];
        
        self.expressStatus = [[UILabel alloc] initWithFrame:CGRectMake(self.expressCompany.frame.origin.x, self.expressCompany.frame.origin.y + self.expressCompany.frame.size.height, kWidth, 20)];
        [self.contentView addSubview:self.expressStatus];
        
        self.expressOrderNumber.backgroundColor = [UIColor yellowColor];
        self.expressCompany.backgroundColor = [UIColor redColor];
        self.expressStatus.backgroundColor = [UIColor purpleColor];
    }
    return self;
}


- (void)setExpress:(Express *)express {
    if (_express != express) {
        _express = express;
        _expressOrderNumber.text = [NSString stringWithFormat:@"订单号:%@",express.expressOrderNumber];
        _expressCompany.text = [NSString stringWithFormat:@"快递种类:%@",express.expressName];
        _expressStatus.text = [NSString stringWithFormat:@"当前状态:%@",express.expressStatus];
    }
    
}

@end
